package com.tqjc.area.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.tqjc.system.core.annotation.QueryField;
import com.tqjc.system.core.model.QueryCondition;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.tomcat.jni.Local;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * @Description: 钢板信息实体类
 * @author: pzy
 * @date: 2023年05月18日 11:05
 */
@TableName(value = "steel_plate")
@Data
@DS("baotou")
@Schema(description = "钢板基本信息")
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SteelPlate extends Model implements Serializable, Cloneable {
    /**
     * 钢板主键
     */
    @TableId(type = IdType.AUTO)
    @Schema(description = "主键ID")
    private String id;
    /**
     * 钢板号
     */
    @Schema(description = "钢板号")
    private String steelId;
    /**
     * 钢板长度
     */
    @Schema(description = "钢板长度")
    private Integer length;
    /**
     * 钢板宽度
     */
    @Schema(description = "钢板宽度")
    private Integer width;
    /**
     * 钢板厚度
     */
    @Schema(description = "钢板厚度")
    private Integer thickness;

    /**
     * 钢板重量
     */
    @Schema(description = "钢板重量")
    private Integer weight;
    /**
     * 所属层数
     */
    @Schema(description = "所属层数")
    private Integer tier;
    /**
     * 钢板所属区域
     */
    @Schema(description = "钢板所属区域")
    @QueryField(queryColumn="area", condition= QueryCondition.eq)
    private String area;

    @Schema(description = "是否在垛位")
    private Integer inStock;

    /**
     * 钢板所属区域类型
     */
    @Schema(description = "钢板所属区域")
    @TableField(exist = false)
    private String areaType;

    /**
     * 钢板所属区域id
     */
    @Schema(description = "钢板区域id")
    @TableField(exist = false)
    private String areaId;


    @TableField(value="CREATE_NAME", fill= FieldFill.INSERT)
    private String createName;

    @TableField(value="CREATE_DATE", fill=FieldFill.INSERT)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createDate;

    @TableField(value="UPDATE_NAME", fill=FieldFill.UPDATE)
    private String updateName;

    @TableField(value="UPDATE_DATE", fill=FieldFill.UPDATE)
    private Date updateDate;
}

